// 客户管理

export default {
  //------------------------   商城客户  ----------------------------
  // 关键词搜索城市列表
  // loadCitiesListServer(params, callback) {
  //   Vue.http.get('/cities.json', {
  //     params: params
  //   }).then(function (response) {
  //     callback(response.data);
  //   });
  // },

  // 获取默认热门城市列表
  // loadHotCitiesListServer(callback) {
  //   Vue.http.get('/hot/cities.json').then(function (response) {
  //     callback(response.data);
  //   });
  // },
  //商城客户--获取城市
  loadCitySelectServer(callback) {
    Vue.http.get('/base/city/all.json').then( (response)=> {
      callback(response.data);
    });
  },
  // 商城客户--获取站点列表
  // loadSiteListServer(params,callback) {
  //   Vue.http.get('/seller/siteList.json',{params:params}).then( (response)=> {
  //     callback(response.data);
  //   });
  // },
  // 获取商城客户列表
  loadSellerListServer(params, callback) {
    Vue.http.get('/seller/listPage.json', {
      params: params
    }).then(function (response) {
      callback(response.data);
    });
  },

  // 获取商城客户详情
  loadSellerDetailServer(params, callback) {
    Vue.http.get('/seller/detail.json', {
      params: params
    }).then(function (response) {
      callback(response.data);
    });
  },

  // 新增商城客户
  addSellerServer(params, callback_success, callback_error) {
    Vue.http.post('/seller/add.json', params).then(function (response) {
      callback_success(response);
    }, function (response) {
      callback_error(response);
    });
  },

  // 编辑商城客户
  modifySellerServer(params, callback_success, callback_error) {
    Vue.http.put('/seller/modify.json', params).then(function (response) {
      callback_success(response);
    }, function (response) {
      callback_error(response);
    });
  },

  //物业客户--新增
  addPropertyCustomerServer(params, callback_success, callback_error) {
    Vue.http.post('/property/customer/add.json', params).then(function (response) {
      callback_success(response);
    }, function (response) {
      callback_error(response);
    });
  },

  // 物业客户--编辑
  editPropertyCustomerServer(params, callback_success, callback_error) {
    Vue.http.put('/property/customer/modify.json', params).then(function (response) {
      callback_success(response);
    }, function (response) {
      callback_error(response);
    });
  },

  //物业客户--城市列表
  loadCitiesInPropertyCustomerServer(callback) {
    Vue.http.get('/property/customer/city.json').then(function (response) {
      callback(response.data);
    });
  },
  //物业客户--根据城市加载站点
  loadSiteByCityServer(params, callback) {
    Vue.http.get('/property/customer/site.json', {
      params: params
    }).then(function (response) {
      callback(response.data);
    });
  },
  //物业客户--客户详情
  loadPropertyCustomerDetailServer(params, callback) {
    Vue.http.get('/property/customer/detail.json', {
      params: params
    }).then(function (response) {
      callback(response.data);
    });
  },
  //物业客户--客户列表
  loadPropertyCustomerServer(params, callback) {
    Vue.http.get('/property/customer/listPage.json', {
      params: params
    }).then(function (response) {
      callback(response.data);
    });
  },
}
